<template>
  <div class="address-main">
    <div class="address-header">
      <span @click="goBack"><van-icon name="arrow-left" /></span>
      <div class="center">新增地址/修改地址</div>
      <i class="save">保存</i>
    </div>
    <div class="address-form">
      <el-input placeholder="收获人姓名" show-word-limit maxlength="64"></el-input>
      <el-input style="margin-top: 15px" show-word-limit placeholder="请输入邮箱"  maxlength="64"></el-input>
      <el-input style="margin-top: 15px" show-word-limit placeholder="请输入手机号"  maxlength="64"></el-input>
      <div class="select">
        <el-select style="margin-right: 10px" v-model="value" placeholder="请选择">
          <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-select style="margin-right: 10px" v-model="value" placeholder="请选择">
          <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-select v-model="value" placeholder="请选择">
          <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
      </div>
      <el-input style="margin-top: 15px" show-word-limit placeholder="邮编"  maxlength="32"></el-input>
      <el-input
          type="textarea"
          placeholder="收获地址"
          rows="3"
          style="margin-top: 15px"
          v-model="value"
          maxlength="30"
          show-word-limit
      />
      <div class="button-switch">
        <span>设为默认地址</span>
        <el-switch
            v-model="open"
            active-color="#002FFF"
            inactive-color="#f2f2f2">
        </el-switch>

      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data(){
      return{
        open: true,
        options: [{
          value: '选项1',
          label: '1'
        }, {
          value: '选项2',
          label: '2'
        }, {
          value: '选项3',
          label: '3'
        }, {
          value: '选项4',
          label: '4'
        }, {
          value: '选项5',
          label: '5'
        }],
        value: ''
      }
    },
    methods: {
      goBack() {
        this.$router.go(-1)
      },
    }
  }
</script>

<style scoped lang="scss">
.address-main {
  width: 100%;
  min-height: 100vh;
  position: relative;
  background: #fff;

  .address-header {
    width: 100%;
    height: 45px;
    display: flex;
    background: #fff;
    justify-content: center;
    align-items: center;
    position: relative;

    span {
      position: absolute;
      left: 10px;
    }

    .center {
      width: 100%;
      height: 45px;
      text-align: center;
      line-height: 45px;
      font-size: 15px;
    }
    .save{
      display: flex;
      width: 50px;
      position: absolute;
      color: #aaa;
      font-size: 14px;
      right: 0;
      font-style: normal;
    }
  }
  .address-form{
    width: 100%;
    padding: 3%;
    box-sizing: border-box;
    .select{
      margin-top: 20px;
      width: 100%;
      display: flex;
    }
  }
  .button-switch{
    width: 100%;
    height: 43px;
    border: 1px solid #DCDFE6;
    border-radius: 4px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3%;
    box-sizing: border-box;
    span{
      font-size: 14px;
    }
  }
}
</style>